package core.controls;

import resources.core.controls.ControlStateHelper;
/**
 * Description   : Functional Test Script
 * @author angel.tsvetkov
 */
public class ControlState extends ControlStateHelper
{
	/**
	 * Script Name   : <b>ControlState</b>
	 * Generated     : <b>28.02.2011 15:51:55</b>
	 * Description   : Functional Test Script
	 * Original Host : WinNT Version 5.1  Build 2600 (S)
	 * 
	 * @since  2011/02/28
	 * @author angel.tsvetkov
	 */
	public static boolean isExist(Control<?> control)
	{
		String taskReport = "";
		boolean retVal = true;
		try
		{
			taskReport = "Verify existance of " + control.getDescriptiveName();
			retVal = control.isExist();
		}
		catch (Exception e) {
			setErrorComment(control.getDescriptiveName() + " CAN NOT be found!");
		}
		setTaskResult("Task: Verify existance of " + control.getDescriptiveName(), retVal, taskReport);
		return retVal;
	}
	
	public static boolean isEnabled(Control<?> control)
	{
		String taskReport = "";
		boolean retVal = true;
		try
		{
			taskReport = "Verify whether " + control.getDescriptiveName() + " is enabled!";
			retVal = control.isEnabled();
		}
		catch (Exception e) {
			setErrorComment(control.getDescriptiveName() + " CAN NOT be found!");
		}
		setTaskResult("Task: Verify whether " + control.getDescriptiveName() + " is enabled!", retVal, taskReport);
		return retVal;
	}
}

